## Proper Setup In Tailwind CSS v4, the "jit" (just-in-time) mode no longer requires a dedicated tailwind.config.js (since config files are entirely removed in v4) file to configure the paths to monitor files for class names; instead, it's configured through a CSS file, offering a CSS-first approach with significant performance improvements. The proper setup is a watcher cli compiling the css file that you will deploy. Install with: ``` npm install -D tailwindcss@4.1.3 @tailwindcss/cli@4.1.3 ``` If by the time you're reading this guide, v4 is obsoleted, you may install an above v4 version that will have breaking changes without clear errors (TailwindCSS has been like that with version changes). In that case, stick to v4 by first installing witih: ``` npm install -D tailwindcss@4.1.3 @tailwindcss/cli@4.1.3 ``` Adjust your source css file, eg. `tw.css`: - One single import line is all you need for tailwind to work. - You can configure the source (relative to the css file) where the html and js files are monitored for picking up classes and writing to the final css file: ``` @import "tailwindcss"; @source "../"; ``` The command to leverage html and js files monitoring is: ``` npx @tailwindcss/cli -i ./tw.css -o ./compiled-tw.css --watch ``` Alternately, this command works too: ``` npx tailwindcss -i ./tw.css -o ./compiled-tw.css --watch ``` --- ## Proper Setup - Walkthrough Empty folder. npm init --y touch index.html index.html: ```